/**
 * ajax的定制版
 * @param {Object} url
 * @param {Object} type
 * @param {Object} data
 * @param {Object} succall
 */
var sendAjax = function(url, type, data, succall) {
	$.ajax({
		url: url,
		type: type,
		data: data,
		success: function(result, status, xhr) {
			if(result.success){
				succall(result);
			}
		},
	});
};

urlParamsObj = {};
/**
 * 获取url参数对象（for iframe-url传参）
 */
var getUrlParamsObj = function(){
	if(!urlParamsObj){
		var url = location.href; // http/xxx.com/?a=1&b=2
		if(url.indexOf('?')>0){
			var paramsArr = url.substring(url.indexOf('?')+1, url.length).split('&'); //['a=1', 'b=2']
			if(paramsArr){
				for(var i=0; i<paramsArr.length; i++){
					var str = paramsArr[i]; // 'a=1'
					urlParamsObj[str.substring(0, str.indexOf('='))] = str.substring(str.indexOf('=')+1, str.length);
				}
			}
		}
	}
	
	return urlParamsObj;
};
